Imports System.Xml.Serialization
Namespace Mapping

    Public Class MappingFragment
        Inherits XEntityModelElementBase

        ''' <summary>Initializes an instance of the <see cref="MappingFragment" /> class.
        ''' This is the default constructor for this class.</summary>
        Public Sub New()
            MyBase.New("MappingFragment", CSXmlNamespace)
        End Sub

        ''' <summary>Initializes an instance of the <see cref="MappingFragment" /> class.</summary>
        ''' <param name="other">An <see cref="System.Xml.Linq.XElement"/> object to copy from.</param>
        Public Sub New(ByVal other As XElement)
            MyBase.New(other)
        End Sub

        Private __ScalarProperties As ScalarPropertyCollection
        Private __ComplexProperties As ComplexPropertyCollection
        Private __Conditions As ConditionCollection

        <AutoLoad()> _
        <XmlElement("ComplexProperty", GetType(ComplexProperty))> _
        Public ReadOnly Property ComplexProperties() As ComplexPropertyCollection
            Get
                If (__ComplexProperties Is Nothing) Then
                    __ComplexProperties = New EdmxEditor.Mapping.ComplexPropertyCollection(Me, MyBase.Name.Namespace, "ComplexProperty")
                End If
                Return __ComplexProperties
            End Get
        End Property

        <AutoLoad()> _
        <XmlElement("Condition", GetType(Condition))> _
        Public ReadOnly Property Conditions() As ConditionCollection
            Get
                If (__Conditions Is Nothing) Then
                    __Conditions = New EdmxEditor.Mapping.ConditionCollection(Me, MyBase.Name.Namespace, "Condition")
                End If
                Return __Conditions
            End Get
        End Property

        <AutoLoad()> _
        <XmlElement("ScalarProperty", GetType(ScalarProperty))> _
        Public ReadOnly Property ScalarProperties() As ScalarPropertyCollection
            Get
                If (__ScalarProperties Is Nothing) Then
                    __ScalarProperties = New EdmxEditor.Mapping.ScalarPropertyCollection(Me, MyBase.Name.Namespace, "ScalarProperty")
                End If
                Return __ScalarProperties
            End Get
        End Property

        <XmlAttribute()> _
        Public Property StoreEntitySet() As String
            Get
                Return Me.@StoreEntitySet
            End Get
            Set(ByVal value As String)
                Me.@StoreEntitySet = value
            End Set
        End Property

    End Class

End Namespace